package s47.dqj.dao;

import java.util.List;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

import s47.dqj.bean.DepartmentDateDetail;

/**
 * 7.科室人员排班详情表
 * @author Administrator
 *
 */
@Repository("departmentDateDetailDaoImpl")
public class DepartmentDateDetailDaoImpl extends HibernateDaoSupport implements DepartmentDateDetailDaoInf{
	
	/* (non-Javadoc)
	 * @see s47.dqj.dao.DepartmentDateDetailDaoInf#setSupperSessionFactory(org.hibernate.SessionFactory)
	 */
	@Override
	@Resource(name="sessionFactory")
	public void setSupperSessionFactory(SessionFactory sessionFactory){
		super.setSessionFactory(sessionFactory);
	}
	/* (non-Javadoc)
	 * @see s47.dqj.dao.DepartmentDateDetailDaoInf#findAllByDdid(s47.dqj.bean.DepartmentDateDetail)
	 */
	@Override
	public List<DepartmentDateDetail> findAllByDdid(DepartmentDateDetail departmentDateDetail){
		String hql="from DepartmentDateDetail as ddd where ddd.ddid='"+departmentDateDetail.getDdid()+"'";
		return getHibernateTemplate().find(hql);
	}
	/* (non-Javadoc)
	 * @see s47.dqj.dao.DepartmentDateDetailDaoInf#save(s47.dqj.bean.DepartmentDateDetail)
	 */
	@Override
	public void save(DepartmentDateDetail departmentDateDetail){
		getHibernateTemplate().save(departmentDateDetail);
	}
	/* (non-Javadoc)
	 * @see s47.dqj.dao.DepartmentDateDetailDaoInf#update(s47.dqj.bean.DepartmentDateDetail)
	 */
	@Override
	public void update(DepartmentDateDetail departmentDateDetail){
		getHibernateTemplate().update(departmentDateDetail);
	}
	/* (non-Javadoc)
	 * @see s47.dqj.dao.DepartmentDateDetailDaoInf#delete(s47.dqj.bean.DepartmentDateDetail)
	 */
	@Override
	public void delete(DepartmentDateDetail departmentDateDetail){
		getHibernateTemplate().delete(departmentDateDetail);
	}
}
